/*
 * Copyright (C) 2024-2025 Deepin Technology Co., Ltd.
 *
 * Author:     zhangbingyi <zhangbingyi@uniontech.com>
 *
 * Maintainer: zhangbingyi <zhangbingyi@uniontech.com>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
#pragma once

#include "common/defenderprocinfolist.h"

#include <QObject>

class DBusInvokerInterface;
class SettingsInvokerInterface;

class NetCtrlModel : public QObject
{
    Q_OBJECT
public:
    explicit NetCtrlModel(QObject *parent = nullptr);
    ~NetCtrlModel();

    // 异步获取联网管控应用信息
    void asyncGetNetAppInfoList();
    // 改变联网管控应用状态
    void changeNetAppStatus(const QString &pkgName, int status);
    // 联网管控功能是否开启
    bool isNetCtrlOpen();
    // 添加日志
    void addSecurityLog(int type, const QString &log);

Q_SIGNALS:
    // 发送联网管控应用信息
    void sendNetAppInfoList(const DefenderProcInfoList &appInfoList);

private:
    // 初始化数据
    void initData();

    // 初始化信号
    void initSignalSLot();

private:
    DBusInvokerInterface *m_DataInterFaceServer; // 流量监控dbus类
    DBusInvokerInterface *m_monitorInterFaceServer; // 流量监控dbus类
    SettingsInvokerInterface *m_gsetting; // 安全中心gsetting配置
};
